package com.huage_07.lesson_04;

import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;

public class ArrayListCopyDemo {
    public static void main(String[] args) throws IOException {

        ArrayList<String> array = new ArrayList<String>();

        array.add("Hello");
        array.add("World");
        array.add("Java");

        BufferedWriter bw = new BufferedWriter(new FileWriter("class1\\src\\com\\huage_07\\lesson_04\\array.txt"));

        for (String s : array){
            bw.write(s);
            bw.newLine();
            bw.flush();
        }

        bw.close();
    }
}
